package ccm.itesm.mx.servicios;

import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;

public class Calificaciones extends ListActivity{
	

	  /** Called when the activity is first created. */
	private String opciones[];
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.faltas);
       // Bundle bundle = this.getIntent().getExtras();
       opciones = new String[]{"Parcial1","Parcial2","Parcial3","Final"};
       this.setListAdapter(new ArrayAdapter<String>
       (this, R.layout.listactivity,opciones));
		//LinearLayout ln = (LinearLayout)this.findViewById(R.id.linearLayout1);
        //ln.setBackgroundColor(this.getResources().getColor(R.color.azul));

       
        // setContentView(R.layout.main);
        
    }
	/* (non-Javadoc)
	 * @see android.app.ListActivity#onListItemClick(android.widget.ListView, android.view.View, int, long)
	 */
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		// TODO Auto-generated method stub
		super.onListItemClick(l, v, position, id);
		
		switch(position){
		case 0:
			
			//this.startActivity(new Intent(this, CalificacionesParcial1.class));
			Bundle bundle = this.getIntent().getExtras();
			System.out.println("RECIBI--------> " + bundle.get("matricula"));
			Intent intento  = new Intent (getApplicationContext(),CalificacionesParcial1.class);
			intento.putExtras(bundle);
			startActivityForResult(intento, 0);
			break;
		case 1:
			//this.startActivity(new Intent(this, CalificacionesParcial2.class));
			Bundle bundle2 = this.getIntent().getExtras();
			System.out.println("RECIBI--------> " + bundle2.get("matricula"));
			Intent intento2  = new Intent (getApplicationContext(),CalificacionesParcial2.class);
			intento2.putExtras(bundle2);
			startActivityForResult(intento2, 0);
			
			
			break;
		case 2:
			this.startActivity(new Intent(this, CalificacionesParcial3.class));
			break;
		case 3:
			this.startActivity(new Intent(this, CalificacionFinal.class));
			break;
		case 4:
			this.startActivity(new Intent(this, Calificaciones1.class));
			break;

			
		}
		}
	}
